package com.example.demo.utils;

import java.util.Map;

/**
 * @ClassName Tools
 * @Author 小坏
 * @Date 2021/12/10、14:37
 * @Version 1.0
 */
public class Tools {

    /**
     * map 转json
     * @param map
     * @return
     */
    public static String map2String(Map<String, Object> map) {
        if (null == map || map.isEmpty()) {
            return null;
        }

        StringBuilder sb = new StringBuilder();
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            sb.append(entry.getValue());
        }

        return sb.toString();
    }

}
